import numpy as np
import pandas as pd


# https://pandas.pydata.org/pandas-docs/stable/user_guide/10min.html
# read_csv to_csv
iris = pd.read_csv('iris.data', header=None)
print(iris)
iris.to_csv('test.csv', index=False, header=None)

# what is a DataFrame
df = pd.DataFrame(
        {
            "A": 1.0,
            "B": pd.Timestamp("20210909"),
            "C": pd.Series(1, index=list(range(4)), dtype="float32"),
            "D": np.array([3] * 4, dtype="int32"),
            "E": pd.Categorical(["test", "train", "test", "train"]),
            "F": "foo",
        }
    )
print(df)

# indexing
print(df.loc[1, 'E'])
print(df.iloc[1, 4])

# converting to numpy
nn = df.to_numpy()
print(nn)
